package com.weixin1.service;

import com.weixin1.bean.Case;
import com.weixin1.dao.CaseDao;

import java.sql.SQLException;
import java.util.List;

/**
 * 案例业务层
 */
public class CaseService {
    private CaseDao cd=new CaseDao();

    //增加案例
    public boolean save(Case ca) throws SQLException {
        return cd.save(ca)>0;
    }

    //删除案例
    public boolean removeById(int id) throws SQLException {
        return cd.removeById(id)>0;
    }

    //查询全部案例
    public List<Case> list() throws SQLException {
        return cd.list();
    }

    //查询单个案例
    public Case getById(int id) throws SQLException {
        return cd.getById(id);
    }
    //修改案例内容
    public boolean update(Case ca) throws SQLException {
        return cd.update(ca)>0;
    }

}
